import request from '@/utils/request'

/**
 * 获取菜单树形
 * @param {PageJS,limit} data 
 * @returns 
 */
export function getPageList(data) {
    return request({
        url: '/admin/root/rootList',
        method: 'post',
        data
    })
}

/**
 * 删除菜单数据
 * @param {id} data 
 * @returns 
 */
export function delPage(data) {
    return request({
        url: '/admin/root/delRoot',
        method: 'post',
        data
    })
}

/**
 * 添加菜单
 * @param {root_name,pid,permission,sort} data 
 */
export function addPage(data) {
    return request({
        url: '/admin/root/addRoot',
        method: 'post',
        data
    })
}

/**
 * 编辑菜单
 * @param {root_name,pid,sort,id} data 
 */
export function editPage(data) {
    return request({
        url: '/admin/root/editRoot',
        method: 'post',
        data
    })
}